﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Ruddish.UI.UserControls
{
    public partial class UC_Setup : UserControl
    {
        public UC_Setup()
        {
            InitializeComponent();
        }

        private void panel3_Paint(object sender, PaintEventArgs e)
        {

        }

        private void UC_Setup_Load(object sender, EventArgs e)
        {
            UC_Setup_DataDatum uC_Setup_DataDatum = new UC_Setup_DataDatum();
            AddControlsTopPanel(uC_Setup_DataDatum);
        }


        /// <summary>
        /// 内框变换
        /// </summary>
        /// <param name="c"></param>
        private void AddControlsTopPanel(Control c)
        {
            c.Dock = DockStyle.Fill;
            panelControls.Controls.Clear();
            panelControls.Controls.Add(c);
        }

        private void butPersonage_Click(object sender, EventArgs e)
        {
            //白块跟随
            moveSidePanel(butPersonage);
            UC_Setup_DataDatum uC_Setup_DataDatum = new UC_Setup_DataDatum();
            AddControlsTopPanel(uC_Setup_DataDatum);
        }

        private void butPrivacy_Click(object sender, EventArgs e)
        {
            //白块跟随
            moveSidePanel(butPrivacy);
            UC_Setup_Privacy uC_Setup_Privac = new UC_Setup_Privacy();
            AddControlsTopPanel(uC_Setup_Privac);
        }

        private void butAbnormal_Click(object sender, EventArgs e)
        {
            //白块跟随
            moveSidePanel(butAbnormal);
            UC_Setup_Abnormal uC_Setup_Abnormal = new UC_Setup_Abnormal();
            AddControlsTopPanel(uC_Setup_Abnormal);
        }

        private void moveSidePanel(Control btn)
        {
            panelSide.Top = btn.Top;
            panelSide.Height = btn.Height;
        }
    }
}
